﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MethodWorx.CMS.Services;
using MethodWorx.CMS.Content;
using System.ComponentModel.DataAnnotations;

namespace MethodWorx.CMS.Requests
{
    public class CreateContentItemRequest
    {
        public CreateContentItemRequest(Page page)
        {
            this.ParentPage = page;
        }
        private string contentName;

        public Page ParentPage { get; private set; }
        public ContentTemplate ExistingContentTemplate { get; set; }
        public string ContentName 
        {
            get { return this.contentName ?? (this.ExistingContentTemplate != null ? this.ExistingContentTemplate.Name : this.NewTemplateName); }
            set { this.contentName = value; }
        }
        public string NewTemplateName { get; set; }
        public int? MinimumRequired { get; set; }
        public int? MaximumAllowed { get; set; }
        public bool CreateAllRequired { get; set; }
    }
}
